package com.ruoyi.system.service.yanglao.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.yanglao.YlPictureMapper;
import com.ruoyi.system.domain.yanglao.YlPicture;
import com.ruoyi.system.service.yanglao.IYlPictureService;

/**
 * 图片Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-06-14
 */
@Service
public class YlPictureServiceImpl implements IYlPictureService 
{
    @Autowired
    private YlPictureMapper ylPictureMapper;

    /**
     * 查询图片
     * 
     * @param id 图片主键
     * @return 图片
     */
    @Override
    public YlPicture selectYlPictureById(Long id)
    {
        return ylPictureMapper.selectYlPictureById(id);
    }

    /**
     * 查询图片列表
     * 
     * @param ylPicture 图片
     * @return 图片
     */
    @Override
    public List<YlPicture> selectYlPictureList(YlPicture ylPicture)
    {
        return ylPictureMapper.selectYlPictureList(ylPicture);
    }

    /**
     * 新增图片
     * 
     * @param ylPicture 图片
     * @return 结果
     */
    @Override
    public int insertYlPicture(YlPicture ylPicture)
    {
        ylPicture.setCreateTime(DateUtils.getNowDate());
        return ylPictureMapper.insertYlPicture(ylPicture);
    }

    /**
     * 修改图片
     * 
     * @param ylPicture 图片
     * @return 结果
     */
    @Override
    public int updateYlPicture(YlPicture ylPicture)
    {
        ylPicture.setUpdateTime(DateUtils.getNowDate());
        return ylPictureMapper.updateYlPicture(ylPicture);
    }

    /**
     * 批量删除图片
     * 
     * @param ids 需要删除的图片主键
     * @return 结果
     */
    @Override
    public int deleteYlPictureByIds(Long[] ids)
    {
        return ylPictureMapper.deleteYlPictureByIds(ids);
    }

    /**
     * 删除图片信息
     * 
     * @param id 图片主键
     * @return 结果
     */
    @Override
    public int deleteYlPictureById(Long id)
    {
        return ylPictureMapper.deleteYlPictureById(id);
    }
}
